#pragma once

#include "fxcc/imgui/Layer.h"
#include "fxcc/core/Dir.h"
#include "fxcc/core/graph/opengl3/Texture2DJack.h"


namespace fxcc
{
	namespace imgui
	{

		struct FXCC_API FileSystemLayer :public fxcc::imgui::Layer
		{
			std::shared_ptr<Dir> m_Dir;

			std::map<std::string, Dir* > m_DirMap;

			void ProcessDir(Dir* dir);

			void SetDirPath(const std::string& dirPath);

			Dir* m_CurrentDir{0};
			
			Dir* m_SelectedDir{ 0 };

			bool m_ChangeFlag{ 0 };
			
			ImVec2 m_LabelSize{ 80,80 };

			int m_ColWidth = 200;

			ImVec2 m_Padding{ 10,10 };

			bool m_HasLoad{ false };

			FileSystemLayer(const std::string& dirPath);

			std::shared_ptr<fxcc::graph::opengl3::Texture2DJack> m_Textures[2];

			void IntoChangeDir();

			void ViewFunc();

			void HandleFunc();

			void HandleSelection() override;

			virtual void OnWindowContextItem() {};

			std::vector<Dir*> m_IndexDirs;


		};
	}
}
